package Guns;

import java.util.ArrayList;

import LifeForms.Robot;

public abstract class Guns{
	protected int clip=0;
	protected int ammo;
	public Guns(Robot robot){
		ammo=(int) robot.getAmmo();
	}
	public void update(Robot robot){
		this.ammo=(int) robot.getAmmo();
		_update();
	}
	public void clip(int ammo){
		if(clip<1){
			if(ammo>6){
				clip+=7;
				ammo-=7;
			}
			else if(ammo>0){
				clip+=ammo;
				ammo-=ammo;
			}
		}
	}
	public void fire(Robot robot, ArrayList<Projectile> projectiles){
		_fire(robot,projectiles);
	}
	abstract void _update();
	abstract void _fire(Robot robot, ArrayList<Projectile> projectiles);
}
